<template>
  <div class="btn-contanier">
    <button class="btn btn-primary btn-ghost btn-multi-border-stroke btn-float-up">
      <div class="btn-borders">
        <div class="border-top"></div>
        <div class="border-right"></div>
        <div class="border-bottom"></div>
        <div class="border-left"></div>
      </div>
      <div class="btn-borders">
        <div class="border-top"></div>
        <div class="border-right"></div>
        <div class="border-bottom"></div>
        <div class="border-left"></div>
      </div>
      <div class="btn-borders">
        <div class="border-top"></div>
        <div class="border-right"></div>
        <div class="border-bottom"></div>
        <div class="border-left"></div>
      </div>
      <span class="btn-text">Start</span>
    </button>
  </div>
</template>
<style lang="scss" scoped>
  .btn-contanier {
    margin-top: 20px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1e23;

    .btn {
      $ease-in-duration: 0.35s;
      $ease-in-direction: cubic-bezier(0.9, 0, 0.8, 0);
      $ease-out-duration: 0.65s;
      $ease-out-delay: $ease-in-duration;
      $ease-out-direction: cubic-bezier(0.2, 1, 0.2, 1);
      $r: 0;
      $g: 185;
      $b: 209;
      position: relative;
      padding: 1em 3em;
      font-size: 1em;
      line-height: 1.5;
      color: white;
      text-decoration: none;
      cursor: pointer;
      background-color: rgb($r, $g, $b);
      border: 1px solid rgb($r, $g, $b);
      transition: 0.25s;

      &-ghost {
        background: transparent;
        border: 1px solid rgb($r, $g, $b);
      }

      &-multi-border-stroke {
        border-color: transparent;

        .btn-borders {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          border: 1px solid rgba($r, $g, $b, 0.65);

          &:nth-child(1) {
            left: -8px;
            padding: 0 8px;
          }

          &:nth-child(2) {
            top: -8px;
            padding: 8px 0;
          }

          &:nth-child(3) {
            top: -4px;
            left: -4px;
            padding: 4px;
          }

          .border-top {
            position: absolute;
            top: 0;
            height: 1px;
            width: 100%;
            background-color: rgb($r, $g, $b);
            transform: scaleX(0);
            transform-origin: left;
            transition: $ease-in-duration $ease-in-direction;
          }

          .border-right {
            position: absolute;
            right: 0;
            width: 1px;
            height: 100%;
            background-color: rgb($r, $g, $b);
            transform: scaleY(0);
            transform-origin: bottom;
            transition: $ease-in-duration $ease-in-direction;
          }

          .border-bottom {
            position: absolute;
            bottom: 0;
            height: 1px;
            width: 100%;
            background-color: rgb($r, $g, $b);
            transform: scaleX(0);
            transform-origin: left;
            transition: $ease-out-duration $ease-out-delay $ease-out-direction;
          }

          .border-left {
            position: absolute;
            left: 0;
            width: 1px;
            height: 100%;
            background-color: rgb($r, $g, $b);
            transform: scaleY(0);
            transform-origin: bottom;
            transition: $ease-out-duration $ease-out-delay $ease-out-direction;
          }
        }

        &:hover {
          background: transparent;

          .border-left {
            transform: scaleY(1);
            transition: $ease-in-duration $ease-in-direction
          }

          .border-bottom {
            transform: scaleX(1);
            transition: $ease-in-duration $ease-in-direction;
          }

          .border-right {
            transform: scaleY(1);
            transition: $ease-out-duration $ease-out-delay $ease-out-direction;
          }

          .border-top {
            transform: scaleX(1);
            transition: $ease-out-duration $ease-out-delay $ease-out-direction;
          }
        }
      }

      &-float-up {
        &::after {
          position: absolute;
          content: 'Start';
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          opacity: 0;
          transform: translateY(25%);
          transition: $ease-in-duration $ease-in-direction
        }

        .btn-text {
          opacity: 1;
          transform: translateY(0);
          transition: $ease-out-duration $ease-out-delay $ease-out-direction;
        }

        &:hover {
          &::after {
            opacity: 1;
            transform: translateY(0);
            transition: $ease-out-duration $ease-out-delay $ease-out-direction;
          }

          .btn-text {
            opacity: 0;
            transform: translateY(-25%);
            transition: $ease-in-duration ease;
          }

        }
      }
    }
  }
</style>
